from django.db import models

from apps.boke_content.models import Blog


class Carousel(models.Model):
    name = models.CharField(max_length=50, verbose_name='名字')
    url = models.CharField(max_length=100, verbose_name='图片路径')
    href = models.CharField(max_length=50, verbose_name='跳转的路径', default='')
    blog = models.ForeignKey(Blog, on_delete=models.SET_NULL, null=True, verbose_name='博客')

    class Meta:
        db_table = 'tb_carousel'
        verbose_name = '轮播图'
        verbose_name_plural = verbose_name
